/* SimpleSell creator portal */
:root {
  --bg: #050606;
  --panel: #0e0f0f;
  --panel-2: #151616;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.15);
  --ink: #f2f2ef;
  --muted: #8b8c89;
  --dim: #5d5e5b;
  --orange: #ef4e23;
  --orange-hi: #ff6a3d;
  --orange-soft: rgba(239, 78, 35, 0.13);
  --ok: #3ccf7e;
  --blue: #5aa2ff;
  --bad: #ff5a4a;
  --f-sans: "Inter Tight", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-wide: "Archivo", "Inter Tight", ui-sans-serif, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
svg { display: block; }
::selection { background: var(--orange); color: #fff; }

.mark { fill: var(--orange); }
.display {
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: -0.05em;
  line-height: 0.92;
}

/* ---------- Buttons + inputs ---------- */
.pbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 0.8em 1.35em;
  font-weight: 500;
  font-size: 0.9rem;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease);
}
.pbtn svg { width: 16px; height: 16px; }
.pbtn:active { transform: scale(0.97); }
.pbtn--orange { background: var(--orange); color: #fff; box-shadow: 0 10px 30px -14px rgba(239, 78, 35, 0.8); }
.pbtn--orange:hover { background: var(--orange-hi); }
.pbtn--ghost { border: 1px solid var(--line-2); }
.pbtn--ghost:hover { border-color: rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.04); }
.pbtn--sm { font-size: 0.8rem; padding: 0.6em 1em; }
.pbtn[disabled] { opacity: 0.55; pointer-events: none; }

.pfield { display: flex; flex-direction: column; gap: 7px; }
.pfield > span { font-size: 0.72rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.pfield small { color: var(--dim); font-size: 0.76rem; }
.pinput {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--ink);
  font: inherit;
  font-size: 0.98rem;
  outline: none;
  transition: border-color 0.3s;
}
.pinput:focus { border-color: var(--orange); }
.pinput[aria-invalid="true"] { border-color: var(--bad); }
textarea.pinput { resize: vertical; min-height: 140px; line-height: 1.5; }
select.pinput { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(-45deg, transparent 50%, var(--muted) 50%); background-position: right 18px center, right 13px center; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.perror { min-height: 1.2em; font-size: 0.82rem; color: var(--bad); }
.pnote { font-size: 0.85rem; color: var(--muted); }

/* ---------- Auth pages ---------- */
.auth {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px 16px;
  background:
    linear-gradient(180deg, rgba(5, 6, 6, 0.55), rgba(5, 6, 6, 0.92)),
    url("/assets/media/hero.jpg") center / cover no-repeat,
    var(--bg);
}
.auth__card {
  width: min(420px, 100%);
  padding: 34px 30px 30px;
  border-radius: 20px;
  background: rgba(14, 15, 15, 0.86);
  border: 1px solid var(--line-2);
  backdrop-filter: blur(18px);
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.9);
}
.auth__brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font-family: var(--f-wide); font-stretch: 125%; font-weight: 800; font-size: 0.95rem; }
.auth__brand svg { width: 24px; height: 24px; }
.auth__title { margin-top: 28px; font-size: 2.1rem; }
.auth__sub { margin-top: 10px; color: var(--muted); }
.auth__form { display: flex; flex-direction: column; gap: 16px; margin-top: 26px; }
.auth__form .pbtn { padding: 0.95em; margin-top: 4px; }
.auth__links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 18px; font-size: 0.85rem; color: var(--muted); }
.auth__links a { text-decoration: none; }
.auth__links a:hover { color: var(--orange-hi); }
.auth__legal { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 0.78rem; color: var(--dim); }
.auth__legal a { color: var(--muted); text-decoration: none; }
.auth__legal a:hover { color: var(--orange-hi); }
.auth__ok { margin-top: 22px; padding: 14px 16px; border-radius: 12px; background: rgba(60, 207, 126, 0.08); border: 1px solid rgba(60, 207, 126, 0.25); color: #bdeed2; font-size: 0.9rem; }

/* ---------- App layout ---------- */
.papp { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.pside {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 24px 16px;
  border-right: 1px solid var(--line);
  background: var(--panel);
}
.pside__brand { display: flex; align-items: center; gap: 9px; padding: 0 8px; text-decoration: none; font-family: var(--f-wide); font-stretch: 125%; font-weight: 800; font-size: 0.92rem; }
.pside__brand svg { width: 22px; height: 22px; }
.pside__brand small { font-family: var(--f-sans); font-stretch: normal; font-weight: 500; font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-left: 2px; }
.pnav { display: flex; flex-direction: column; gap: 2px; }
.pnav a {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  transition: background-color 0.25s, color 0.25s;
}
.pnav a svg { width: 18px; height: 18px; }
.pnav a:hover { background: rgba(255, 255, 255, 0.04); color: var(--ink); }
.pnav a.is-active { background: var(--orange-soft); color: var(--ink); }
.pnav a.is-active svg { color: var(--orange); }
.pnav b { min-width: 20px; padding: 1px 7px; border-radius: 999px; background: var(--orange); color: #fff; font-size: 0.7rem; text-align: center; }
.pnav b:empty { display: none; }
.pside__me { margin-top: auto; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); display: flex; align-items: center; gap: 10px; }
.pside__me div { min-width: 0; }
.pside__me strong { display: block; font-weight: 500; font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pside__me small { display: block; color: var(--dim); font-size: 0.74rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), #8a2a12);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
}

.pmain { min-width: 0; padding: clamp(24px, 4vw, 56px); max-width: 1100px; width: 100%; }
.pview { animation: rise 0.6s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.phead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: clamp(24px, 4vh, 40px); }
.phead h1 { font-size: clamp(2.2rem, 5vw, 4.2rem); }
.phead p { margin-top: 12px; color: var(--muted); max-width: 52ch; }
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 18px; color: var(--muted); text-decoration: none; font-size: 0.85rem; }
.back:hover { color: var(--ink); }
.back svg { width: 16px; height: 16px; }

/* ---------- Dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat {
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  text-decoration: none;
  transition: border-color 0.3s, transform 0.4s var(--ease);
}
.stat:hover { border-color: var(--line-2); transform: translateY(-2px); }
.stat strong { display: block; font-weight: 500; font-size: 2.6rem; letter-spacing: -0.05em; line-height: 1; }
.stat span { display: block; margin-top: 8px; color: var(--muted); font-size: 0.85rem; }
.stat--hot strong { color: var(--orange); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; }
.card { padding: 22px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); }
.card h2 { font-weight: 500; font-size: 1.05rem; letter-spacing: -0.02em; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card__head a { font-size: 0.82rem; color: var(--muted); text-decoration: none; }
.card__head a:hover { color: var(--orange-hi); }
.help { background: radial-gradient(120% 120% at 100% 0%, rgba(239, 78, 35, 0.22), transparent 60%), var(--panel); }
.help p { margin: 10px 0 18px; color: var(--muted); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin-top: 12px; font-size: 0.88rem; }
.kv dt { color: var(--dim); }
.kv dd { margin: 0; word-break: break-word; }

/* ---------- Ticket list ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tab { padding: 0.5em 0.95em; border-radius: 999px; border: 1px solid var(--line-2); font-size: 0.82rem; color: var(--muted); }
.tab:hover { color: var(--ink); }
.tab.is-on { background: var(--ink); color: #0b0b0b; border-color: var(--ink); }
.tlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.trow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 16px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  text-decoration: none;
  transition: border-color 0.3s, background-color 0.3s;
}
.trow:hover { border-color: var(--line-2); background: var(--panel-2); }
.trow__subject { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow.is-new .trow__subject::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--orange); vertical-align: middle; }
.trow__meta { grid-column: 1; font-size: 0.8rem; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .tchip { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.tchip { display: inline-flex; align-items: center; gap: 6px; padding: 0.35em 0.8em; border-radius: 999px; font-size: 0.74rem; font-weight: 500; border: 1px solid var(--line-2); white-space: nowrap; }
.tchip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tchip--open { color: var(--orange-hi); border-color: rgba(239, 78, 35, 0.45); }
.tchip--waiting { color: var(--blue); border-color: rgba(90, 162, 255, 0.45); }
.tchip--closed { color: var(--muted); }
.empty { padding: 40px 20px; text-align: center; color: var(--dim); border: 1px dashed var(--line-2); border-radius: 16px; }

/* ---------- Thread ---------- */
.thead { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; color: var(--muted); font-size: 0.82rem; }
.ttitle { font-size: clamp(1.7rem, 3.4vw, 2.8rem); margin-bottom: 18px; }
.thread { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 84%; padding: 14px 18px 16px; border-radius: 16px; background: var(--panel-2); border: 1px solid var(--line); }
.msg--you { align-self: flex-end; border-bottom-right-radius: 6px; }
.msg--agency { align-self: flex-start; background: linear-gradient(180deg, rgba(239, 78, 35, 0.12), rgba(239, 78, 35, 0.05)); border-color: rgba(239, 78, 35, 0.25); border-bottom-left-radius: 6px; }
.msg__head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 0.8rem; }
.msg__head img { width: 22px; height: 22px; border-radius: 50%; }
.msg__head strong { font-weight: 600; }
.msg__head time { color: var(--dim); }
.msg__body { white-space: pre-wrap; word-break: break-word; line-height: 1.55; }
.reply { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.reply__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.reply__bar .pnote { margin-left: auto; }

/* ---------- Forms (new ticket, profile) ---------- */
.pform { display: flex; flex-direction: column; gap: 18px; max-width: 680px; }
.pform__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.section-title { margin: 40px 0 16px; padding-top: 28px; border-top: 1px solid var(--line); font-weight: 500; font-size: 1.2rem; letter-spacing: -0.02em; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 20px);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #0b0b0b;
  font-weight: 500;
  font-size: 0.86rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease), transform 0.45s var(--ease);
  z-index: 50;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .papp { grid-template-columns: 1fr; }
  .pside {
    position: sticky;
    height: auto;
    z-index: 10;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .pside__brand { padding: 0; }
  .pnav { order: 3; width: 100%; flex-direction: row; overflow-x: auto; }
  .pnav a { grid-template-columns: auto auto; flex: none; }
  .pnav a svg { display: none; }
  .pside__me { margin: 0 0 0 auto; padding: 0; border: 0; background: none; }
  .pside__me div { display: none; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 14px; }
  .stat strong { font-size: 1.9rem; }
  .grid2, .pform__row { grid-template-columns: 1fr; }
  .msg { max-width: 100%; }
}

/* ---------- Shop ---------- */
.testnote { margin: 0 0 16px; padding: 10px 14px; border-radius: 12px; border: 1px dashed rgba(245, 184, 61, 0.5); background: rgba(245, 184, 61, 0.07); color: #f5c968; font-size: 0.85rem; }
.tchip--pdraft, .tchip--parchived { color: var(--muted); }
.tchip--ppending { color: #f5b83d; border-color: rgba(245, 184, 61, 0.45); }
.tchip--plive, .tchip--odelivered { color: var(--ok); border-color: rgba(60, 207, 126, 0.45); }
.tchip--prejected { color: var(--bad); border-color: rgba(255, 90, 74, 0.45); }
.tchip--opaid { color: var(--orange-hi); border-color: rgba(239, 78, 35, 0.5); }
.tchip--oconfirming, .tchip--opartially_paid { color: var(--blue); border-color: rgba(90, 162, 255, 0.45); }

.checklist { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.checklist a { text-decoration: none; }
.checklist a:hover { color: var(--orange-hi); }
.checklist li.is-done a { color: var(--muted); text-decoration: line-through; }
.checklist__tick { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-2); flex: none; }
.checklist li.is-done .checklist__tick { background: var(--ok); border-color: var(--ok); color: #062; }
.checklist__tick svg { width: 13px; height: 13px; }
.shoplink { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.shoplink code { flex: 1; min-width: 200px; padding: 9px 12px; border-radius: 10px; background: var(--bg); font-family: ui-monospace, Menlo, monospace; font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.section-title--first { margin-top: 0; padding-top: 0; border-top: 0; }
.section-sub { margin: 26px 0 12px; font-weight: 500; font-size: 1rem; }
.prefix { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel-2); transition: border-color 0.3s; }
.prefix:focus-within { border-color: var(--orange); }
.prefix em { font-style: normal; padding-left: 14px; color: var(--dim); white-space: nowrap; font-size: 0.92rem; }
.prefix .pinput { border: 0; background: none; padding-left: 4px; }

.wallets { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.wallet { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.wallet > div:first-child { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.wallet code { flex-basis: 100%; font-family: ui-monospace, Menlo, monospace; font-size: 0.8rem; color: var(--muted); word-break: break-all; }
.wallet small { flex-basis: 100%; color: var(--dim); }
.wallet__actions { display: flex; gap: 6px; align-items: flex-start; }

.plist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.prow { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 14px 10px 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); text-decoration: none; transition: border-color 0.3s; }
.prow:hover { border-color: var(--line-2); }
.prow img, .prow__ph { width: 52px; height: 64px; border-radius: 8px; object-fit: cover; background: var(--panel-2); }
.prow strong { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow span { font-size: 0.8rem; color: var(--dim); }

.modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mode { position: relative; display: block; cursor: pointer; }
.mode input { position: absolute; opacity: 0; pointer-events: none; }
.mode > span { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line-2); transition: border-color 0.25s, background-color 0.25s; }
.mode strong { font-weight: 500; }
.mode small { color: var(--muted); font-size: 0.8rem; line-height: 1.4; }
.mode input:checked + span { border-color: var(--orange); background: var(--orange-soft); }
.mode input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: 2px; }

.pv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 16px; align-items: start; }
.pv__img { width: 140px; height: 175px; border-radius: 12px; object-fit: cover; background: var(--panel-2); }
.pv__img--empty { display: grid; place-items: center; color: var(--dim); font-size: 0.8rem; border: 1px dashed var(--line-2); }

.up { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 22px; border-radius: 14px; border: 1.5px dashed var(--line-2); background: var(--panel); cursor: pointer; transition: border-color 0.25s, background-color 0.25s; }
.up:hover, .up.is-over { border-color: var(--orange); background: var(--orange-soft); }
.up__input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.up__label { font-weight: 500; }
.up__hint { font-size: 0.8rem; color: var(--muted); }
.up__bar { height: 4px; margin-top: 10px; border-radius: 4px; background: var(--line); overflow: hidden; opacity: 0; transition: opacity 0.3s; }
.up__bar span { display: block; height: 100%; width: 0; background: var(--orange); transition: width 0.2s; }
.up.is-busy .up__bar { opacity: 1; }
.up.is-busy { pointer-events: none; }
.up__msg { min-height: 1.2em; font-size: 0.8rem; color: var(--muted); }
.up__msg.is-error { color: var(--bad); }

.files { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.files li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); }
.files a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.files a:hover { color: var(--orange-hi); }
.files span { font-size: 0.78rem; color: var(--dim); }

.review-note { margin: 0 0 20px; padding: 14px 16px; border-radius: 12px; border: 1px solid rgba(255, 90, 74, 0.35); background: rgba(255, 90, 74, 0.07); }
.review-note p { margin-top: 4px; color: #f3c5bf; white-space: pre-wrap; }
.review-note--req { border-color: rgba(239, 78, 35, 0.3); background: var(--orange-soft); margin-top: 18px; }
.review-note--req p { color: var(--ink); }
.kv--wide { grid-template-columns: 120px 1fr; font-size: 0.92rem; }

@media (max-width: 860px) {
  .modes, .pv { grid-template-columns: 1fr; }
  .prow { grid-template-columns: 44px minmax(0, 1fr); }
  .prow .tchip { grid-column: 2; justify-self: start; }
  .files li { grid-template-columns: minmax(0, 1fr) auto; }
  .files li span { display: none; }
}
