/* em monitores grandes o portal usa texto um pouco mais compacto */
@media (min-width: 1600px) { html { font-size: 14.5px; } }
[hidden] { display: none !important; }
.portal-body { min-height: 100vh; }
.view { min-height: 100vh; }
.muted { color: var(--offwhite-dim); font-size: 0.9rem; font-weight: 300; line-height: 1.7; }
.muted.small { font-size: 0.78rem; color: var(--cinza); margin: 4px 0 16px; }
.field-help { min-height: 0; }
.field-help:empty { display: none; }

/* ── LOGIN ─────────────────────────────── */
.login-wrap {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 20px;
  background: radial-gradient(ellipse 60% 50% at 50% 30%, rgba(123, 35, 244, 0.16), transparent 70%);
}
.login-logo { margin-bottom: 28px; text-decoration: none; }
.login-card {
  width: 100%; max-width: 420px; background: var(--grafite); border: 1px solid var(--borda);
  border-radius: 20px; padding: 36px;
}
.login-card h1 { font-family: var(--fonte-titulo); font-size: 1.6rem; font-weight: 800; margin-bottom: 6px; }
.login-card__sub { font-size: 0.86rem; color: var(--cinza); margin-bottom: 24px; line-height: 1.6; }
.login-forgot { display: block; margin: 16px auto 0; }
.login-back { margin-top: 22px; font-size: 0.83rem; color: var(--cinza); text-decoration: none; transition: color 0.2s; }
.login-back:hover { color: var(--roxo-claro); }

.link-btn {
  background: none; border: none; color: var(--cinza); font-family: var(--fonte-corpo); font-size: 0.83rem;
  cursor: pointer; padding: 4px 0; transition: color 0.2s;
}
.link-btn:hover { color: var(--roxo-claro); }

.notice {
  display: flex; flex-direction: column; gap: 6px; margin-top: 22px; padding: 14px 16px; border-radius: 12px;
  background: rgba(242, 237, 228, 0.05); border: 1px solid rgba(242, 237, 228, 0.12);
  font-size: 0.82rem; color: var(--offwhite-dim); line-height: 1.55;
}
.notice i { color: var(--roxo-claro); }
.notice--demo { background: rgba(123, 35, 244, 0.1); border-color: rgba(123, 35, 244, 0.35); }
.notice--demo strong { color: var(--roxo-claro); letter-spacing: 0.4px; }
.notice__actions { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: transparent; border: 1px solid var(--borda); color: var(--offwhite);
  font-family: var(--fonte-corpo); font-size: 0.83rem; font-weight: 500;
  padding: 10px 16px; border-radius: 8px; cursor: pointer; transition: all 0.2s ease; text-decoration: none;
}
.btn-ghost:hover { border-color: var(--roxo); color: var(--roxo-claro); }

/* ── TOPO ─────────────────────────────── */
.p-top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 44px; border-bottom: 1px solid var(--borda);
  background: rgba(8, 8, 8, 0.92); backdrop-filter: blur(16px);
  position: sticky; top: 0; z-index: 20;
}
.p-top .hero-logo { margin-bottom: 0; font-size: 1.3rem; text-decoration: none; }
.p-top .logo-mark { height: 28px; }
.p-top__right { display: flex; align-items: center; gap: 14px; font-size: 0.82rem; color: var(--cinza); }

/* ── CONTEÚDO ─────────────────────────────── */
.p-main { max-width: none; margin: 0; padding: 2.25rem clamp(1.5rem, 3vw, 3.75rem) 5.5rem; }
.p-title {
  font-family: var(--fonte-titulo); font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 800;
  letter-spacing: -0.8px; line-height: 1.15; margin-bottom: 14px;
}
.p-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 30px; }
.p-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }

.p-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 22px; align-items: start; }
.p-card { background: var(--grafite); border: 1px solid var(--borda); border-radius: 20px; padding: 30px; margin-bottom: 22px; }
.p-grid .p-card { margin-bottom: 0; }
.p-card h2 { font-family: var(--fonte-titulo); font-size: 1.15rem; font-weight: 800; margin-bottom: 16px; }
.p-card--lucro { background: linear-gradient(160deg, rgba(123, 35, 244, 0.22), var(--grafite) 70%); border-color: rgba(123, 35, 244, 0.4); }
.p-card--lucro .btn-primary { margin-top: 18px; }
.p-card__icon {
  width: 46px; height: 46px; border-radius: 12px; background: rgba(123, 35, 244, 0.18);
  display: flex; align-items: center; justify-content: center; color: var(--roxo-claro); font-size: 1.15rem; margin-bottom: 14px;
}

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.3px;
  background: rgba(242, 237, 228, 0.06); border: 1px solid rgba(242, 237, 228, 0.14); color: var(--offwhite-dim);
}
.chip--brand { background: rgba(123, 35, 244, 0.14); border-color: rgba(123, 35, 244, 0.4); color: var(--roxo-claro); }
.chip--ok { background: rgba(109, 221, 109, 0.1); border-color: rgba(109, 221, 109, 0.3); color: #6ddd6d; }
.chip--warn { background: rgba(255, 196, 77, 0.1); border-color: rgba(255, 196, 77, 0.3); color: #ffc44d; }
.chip--muted { color: var(--cinza); }
.lead-cat-row { display: flex; flex-wrap: wrap; gap: 8px; }
.lead-cat-row .chip b { font-weight: 800; }

.kv { display: flex; flex-direction: column; margin-bottom: 18px; }
.kv > div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--borda); font-size: 0.9rem; }
.kv > div:last-child { border-bottom: none; }
.kv dt { color: var(--cinza); }
.kv dd { color: var(--offwhite); font-weight: 500; text-align: right; }

.dl-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--borda); font-size: 0.9rem; }
.dl-row:last-child { border-bottom: none; }
.dl-row__title { display: flex; flex-direction: column; gap: 2px; }
.dl-row small { color: var(--cinza); font-size: 0.74rem; }
.dl-row__actions { display: flex; align-items: center; gap: 8px; }

.tl { display: flex; flex-direction: column; gap: 20px; }
.tl--admin { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--borda); }
.tl-item { display: flex; gap: 14px; align-items: flex-start; }
.tl-dot {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(123, 35, 244, 0.12); border: 1px solid rgba(123, 35, 244, 0.3); color: var(--roxo-claro); font-size: 0.85rem;
}
.tl-body { flex: 1; min-width: 0; }
.tl-body h4 { font-family: var(--fonte-titulo); font-size: 0.98rem; font-weight: 700; margin-bottom: 2px; }
.tl-body p { font-size: 0.86rem; color: var(--offwhite-dim); font-weight: 300; line-height: 1.6; white-space: pre-line; }
.tl-meta { font-size: 0.72rem; color: var(--cinza); margin-top: 4px; }

.icon-btn { background: none; border: none; color: var(--cinza); cursor: pointer; padding: 6px; border-radius: 6px; transition: color 0.2s; }
.icon-btn:hover { color: #ff7b7b; }
.mini-select {
  background: var(--carvao); border: 1px solid var(--borda); color: var(--offwhite); border-radius: 8px;
  padding: 7px 10px; font-family: var(--fonte-corpo); font-size: 0.78rem; outline: none;
}

/* ── ADMIN ─────────────────────────────── */
.p-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.9rem; margin-bottom: 1.5rem; }
.p-table-wrap { overflow-x: auto; border: 1px solid var(--borda); border-radius: 16px; background: var(--grafite); }
.p-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 640px; }
.p-table th {
  text-align: left; font-size: 0.7rem; letter-spacing: 0.6px; text-transform: uppercase; font-weight: 500;
  color: var(--cinza); padding: 14px 18px; border-bottom: 1px solid var(--borda);
}
.p-table td { padding: 16px 18px; border-bottom: 1px solid var(--borda); }
.p-table tr:last-child td { border-bottom: none; }
.p-table tbody tr { cursor: pointer; }
.p-table tbody tr:hover td { background: rgba(123, 35, 244, 0.07); }
.p-table .cell-name { font-weight: 600; }
.p-table small { display: block; color: var(--cinza); font-size: 0.74rem; font-weight: 400; }

.grid-form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.grid-form .span-2 { grid-column: span 2; }
.grid-form .span-3 { grid-column: span 3; }
.stack-form { margin-bottom: 4px; }
.form-group textarea {
  width: 100%; padding: 12px 15px; background: var(--carvao); border: 1px solid var(--borda); border-radius: 8px;
  color: var(--offwhite); font-family: var(--fonte-corpo); font-size: 0.93rem; outline: none; resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-group textarea:focus { border-color: var(--roxo); box-shadow: 0 0 0 3px rgba(123, 35, 244, 0.12); }
.form-group input[type="date"], .form-group input[type="number"] { color-scheme: dark; }
.form-group input[type="file"], .contract-actions input[type="file"] { color: var(--offwhite-dim); font-size: 0.85rem; }
.form-group select { background-image: none; }
#detailExtras { margin-top: 22px; }
#backToList { margin-bottom: 14px; }
.contract-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }

@media (max-width: 900px) {
  .p-top { padding: 14px 20px; }
  .p-top__right #clientWho, .p-top__right #adminWho { display: none; }
  .p-main { padding: 30px 20px 70px; }
  .p-grid { grid-template-columns: 1fr; }
  .p-stats { grid-template-columns: 1fr; }
  .grid-form { grid-template-columns: 1fr; }
  .grid-form .span-2, .grid-form .span-3 { grid-column: span 1; }
  .login-card { padding: 28px 22px; }
}

/* ── LINK DE ACESSO / AJUSTES ─────────────────────────────── */
a.link-btn { text-decoration: none; text-align: center; }
.invite-result { margin-top: 18px; }
.invite-link {
  flex: 1; min-width: 220px; padding: 11px 14px; background: var(--carvao); border: 1px solid var(--borda);
  border-radius: 8px; color: var(--offwhite); font-family: var(--fonte-corpo); font-size: 0.82rem; outline: none;
}

/* ── BARRA LATERAL (ícones + nome ao passar o mouse) ─────────────────────────────── */
.shell { display: flex; min-height: 100vh; }
.shell[hidden] { display: none !important; }
.shell__main { flex: 1; min-width: 0; }
.rail {
  width: 4.25rem; flex-shrink: 0; position: sticky; top: 0; height: 100vh; z-index: 30;
  background: var(--grafite); border-right: 1px solid var(--borda);
  display: flex; flex-direction: column; align-items: center; padding: 14px 0;
}
.rail__items { display: flex; flex-direction: column; gap: 8px; margin-top: 26px; }
.rail__bottom { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.rail__btn {
  position: relative; width: 2.875rem; height: 2.875rem; border-radius: 0.75rem; border: none; background: transparent;
  display: flex; align-items: center; justify-content: center;
  color: var(--offwhite-dim); font-size: 1.08rem; cursor: pointer; text-decoration: none; transition: background 0.2s, color 0.2s;
}
.rail__btn:hover { background: #24242d; color: #fff; }
.rail__btn.is-active { background: #2b2b37; color: var(--roxo-claro); }
.rail__btn--danger { color: #ff5a5a; }
.rail__btn--danger:hover { background: rgba(255, 90, 90, 0.12); color: #ff7b7b; }
.rail__user { cursor: default; }
.rail__logo { width: 3.5rem; height: 3.1rem; margin-top: 2px; }
.rail__logo img { height: 3.25rem; width: 3.25rem; max-width: none; display: block; }
.rail__btn::after {
  content: attr(data-tip); position: absolute; left: calc(100% + 12px); top: 50%;
  transform: translateY(-50%) translateX(-4px);
  background: #fff; color: #15151a; font-family: var(--fonte-corpo); font-size: 0.8rem; font-weight: 500;
  padding: 8px 12px; border-radius: 8px; white-space: nowrap; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  opacity: 0; pointer-events: none; transition: opacity 0.15s, transform 0.15s; z-index: 60;
}
.rail__btn[data-tip=""]::after { display: none; }
.rail__btn:hover::after, .rail__btn:focus-visible::after { opacity: 1; transform: translateY(-50%) translateX(0); }
.rail__btn:focus-visible { outline: 2px solid var(--roxo); outline-offset: 2px; }

/* ── ABAS DENTRO DO CLIENTE (admin) ─────────────────────────────── */
.subtabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0 22px; border-bottom: 1px solid var(--borda); }
.subtab {
  display: inline-flex; align-items: center; gap: 8px; background: none; border: none; border-bottom: 2px solid transparent;
  margin-bottom: -1px; padding: 11px 14px; color: var(--cinza); font-family: var(--fonte-corpo); font-size: 0.86rem; font-weight: 500;
  cursor: pointer; transition: color 0.2s, border-color 0.2s;
}
.subtab:hover { color: var(--offwhite); }
.subtab.is-active { color: var(--roxo-claro); border-bottom-color: var(--roxo); }
.subtab[hidden] { display: none; }

/* renovações no painel */
.renew-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--borda); cursor: pointer; font-size: 0.9rem; }
.renew-row:last-child { border-bottom: none; }
.renew-row:hover .renew-row__name { color: var(--roxo-claro); }
.renew-row__name { font-weight: 600; transition: color 0.2s; }
.renew-row small { display: block; color: var(--cinza); font-size: 0.74rem; font-weight: 400; }

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .rail {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; width: 100%; height: 62px; z-index: 40;
    flex-direction: row; justify-content: space-between; align-items: center; padding: 0 10px;
    border-right: none; border-top: 1px solid var(--borda);
  }
  .rail__logo { display: none; }
  .rail__items { flex-direction: row; margin-top: 0; gap: 2px; }
  .rail__bottom { margin-top: 0; flex-direction: row; gap: 2px; }
  .rail__btn { width: 40px; height: 40px; font-size: 1rem; }
  .rail__btn::after { display: none; }
  .p-main { padding-bottom: 100px; }
}
.chip--danger { background: rgba(255, 90, 90, 0.1); border-color: rgba(255, 90, 90, 0.35); color: #ff7b7b; }

/* faixa "vendo como cliente" (admin) */
.preview-banner {
  position: sticky; top: 0; z-index: 25; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0.65rem clamp(1.5rem, 3vw, 3.75rem); background: rgba(123, 35, 244, 0.18); border-bottom: 1px solid rgba(123, 35, 244, 0.45);
  color: var(--roxo-claro); font-size: 0.85rem; backdrop-filter: blur(10px);
}
.preview-banner .btn-ghost { padding: 7px 12px; }
@media (max-width: 900px) { .preview-banner { padding: 0.6rem 1rem; flex-wrap: wrap; } }

/* ── LINK DA BIO: editor (admin) ─────────────────────────────── */
.mini-label { display: block; font-size: 0.72rem; font-weight: 500; color: var(--cinza); text-transform: uppercase; letter-spacing: 0.6px; margin: 14px 0 6px; }
.bio-url { margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--borda); }
.slug-input { display: flex; align-items: stretch; background: var(--carvao); border: 1px solid var(--borda); border-radius: 8px; overflow: hidden; }
.slug-input:focus-within { border-color: var(--roxo); box-shadow: 0 0 0 3px rgba(123, 35, 244, 0.12); }
.slug-input span { padding: 12px 0 12px 15px; color: var(--cinza); font-size: 0.9rem; white-space: nowrap; }
.form-group .slug-input input { border: none; box-shadow: none; background: transparent; padding-left: 2px; }
.color-input { height: 46px; padding: 4px !important; cursor: pointer; }
.form-group label.check { display: flex; align-items: center; gap: 10px; text-transform: none; letter-spacing: 0; font-size: 0.9rem; color: var(--offwhite); cursor: pointer; }
.form-group label.check input { width: auto; accent-color: var(--roxo); }

.bl-add { display: grid; grid-template-columns: 9.5rem 1fr 1.4fr auto; gap: 10px; margin-bottom: 18px; align-items: center; }
.bl-add select, .bl-add input, .bl-row select, .bl-row input[type="text"] {
  background: var(--carvao); border: 1px solid var(--borda); border-radius: 8px; color: var(--offwhite);
  font-family: var(--fonte-corpo); font-size: 0.86rem; padding: 10px 12px; outline: none; min-width: 0; width: 100%;
}
.bl-add select:focus, .bl-add input:focus, .bl-row select:focus, .bl-row input:focus { border-color: var(--roxo); }
.bl-row { display: grid; grid-template-columns: 1.6rem 9.5rem 1fr 1.4fr auto auto; gap: 10px; align-items: center; padding: 12px 0; border-top: 1px solid var(--borda); }
.bl-row.is-off { opacity: 0.55; }
.bl-row .bl-active { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--offwhite-dim); white-space: nowrap; }
.bl-row .bl-active input { accent-color: var(--roxo); }
.bl-row .bl-actions { display: flex; gap: 2px; }
.icon-btn:hover { color: var(--roxo-claro); }
.icon-btn[data-act="del"]:hover { color: #ff7b7b; }

/* ── LINK DA BIO: métricas ─────────────────────────────── */
.mt-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.mt-head h2 { margin: 0; }
.period { display: inline-flex; background: var(--grafite); border: 1px solid var(--borda); border-radius: 10px; padding: 3px; }
.period-btn { background: none; border: none; color: var(--cinza); font-family: var(--fonte-corpo); font-size: 0.8rem; font-weight: 500; padding: 7px 14px; border-radius: 8px; cursor: pointer; transition: all 0.2s; }
.period-btn:hover { color: var(--offwhite); }
.period-btn.is-active { background: var(--roxo); color: #fff; }

.mt-chart { display: flex; align-items: stretch; gap: 3px; height: 11rem; }
.mt-col { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; }
.mt-bars { flex: 1; display: flex; align-items: flex-end; gap: 2px; }
.mt-bar { flex: 1; min-height: 2px; border-radius: 3px 3px 0 0; transition: height 0.4s ease; }
.mt-bar--views { background: #4b2f8a; }
.mt-bar--clicks { background: var(--roxo-claro); }
.mt-col:hover .mt-bar--views { background: #6640b8; }
.mt-lbl { height: 1.1rem; font-size: 0.66rem; color: var(--cinza); text-align: center; white-space: nowrap; margin-top: 6px; overflow: visible; }
.mt-legend { display: flex; gap: 18px; margin-top: 12px; font-size: 0.78rem; color: var(--offwhite-dim); }
.mt-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }

.mt-row { padding: 11px 0; border-bottom: 1px solid var(--borda); }
.mt-row:last-child { border-bottom: none; }
.mt-row__top { display: flex; justify-content: space-between; gap: 12px; font-size: 0.9rem; margin-bottom: 7px; }
.mt-row__top i { color: var(--roxo-claro); width: 1.2rem; text-align: center; margin-right: 4px; }
.mt-row__top small { color: var(--cinza); font-weight: 400; }
.mt-track { height: 6px; background: var(--carvao); border-radius: 999px; overflow: hidden; }
.mt-track span { display: block; height: 100%; background: linear-gradient(90deg, var(--roxo), var(--roxo-claro)); border-radius: 999px; }
.mt-note { margin-top: 12px; }
.bio-box .contract-actions { margin-top: 4px; }

@media (max-width: 900px) {
  .bl-add { grid-template-columns: 1fr; }
  .bl-row { grid-template-columns: 1.6rem 1fr; }
  .bl-row input[data-f="url"], .bl-row input[data-f="label"] { grid-column: span 2; }
}

/* ── PRÉVIA DA PÁGINA (moldura de celular) ─────────────────────────────── */
.mt-layout, .bed { display: block; }
.mt-layout.has-phone, .bed.has-phone { display: grid; grid-template-columns: 17.5rem minmax(0, 1fr); gap: 1.8rem; align-items: start; }
.mt-phone, .bed__phone { position: sticky; top: 1.5rem; }
.bed__phone .muted.small { text-align: center; margin: 0.9rem 0 0; }
.mt-layout > .mt-main, .bed__forms { min-width: 0; }
.phone {
  position: relative; width: 100%; aspect-ratio: 9 / 18.5; background: #000; border: 0.55rem solid #1d1d26;
  border-radius: 2.2rem; overflow: hidden; box-shadow: 0 24px 60px -18px rgba(0, 0, 0, 0.7), 0 0 0 1px #2c2c38;
}
.phone__notch { position: absolute; top: 0.4rem; left: 50%; transform: translateX(-50%); width: 34%; height: 0.95rem; background: #1d1d26; border-radius: 999px; z-index: 2; }
.phone__screen { position: absolute; inset: 0; overflow: hidden; background: #0a0a0d; }
.phone iframe { border: 0; display: block; transform-origin: 0 0; background: transparent; }
.mt-phone__link { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 0.9rem; font-size: 0.82rem; color: var(--cinza); text-decoration: none; transition: color 0.2s; }
.mt-phone__link:hover { color: var(--roxo-claro); }

.bl-ico { display: flex; align-items: center; justify-content: center; color: var(--roxo-claro); font-size: 1rem; }
.bed__forms .p-card { margin-bottom: 1.2rem; }
.color-input { width: 100%; }

@media (max-width: 1100px) {
  .mt-layout.has-phone, .bed.has-phone { grid-template-columns: 1fr; }
  .mt-phone, .bed__phone { position: static; width: 15rem; margin: 0 auto 1.4rem; }
}
.mt-main .p-stats { grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); }

/* ── PRÉVIA FIXA E MAIOR ─────────────────────────────── */
/* "hidden" no html/body quebra o position: sticky; "clip" corta igual sem quebrar */
html, body.portal-body { overflow-x: clip; }
.mt-layout.has-phone, .bed.has-phone { grid-template-columns: 26rem minmax(0, 1fr); }
.mt-phone, .bed__phone { position: sticky; top: 1.25rem; align-self: start; }
.phone { width: min(100%, calc((100vh - 4.5rem) * 0.4865)); margin: 0 auto; }
@media (max-width: 1100px) {
  .mt-layout.has-phone, .bed.has-phone { grid-template-columns: 1fr; }
  .mt-phone, .bed__phone { position: static; }
  .phone { width: 17rem; }
}
