/* ============================================
   PLANEJAMENTO MENSAL (página interna)
   ============================================ */

.pl-empty { padding: 2.5rem 1rem; text-align: center; color: var(--text-muted); font-size: 0.9rem; grid-column: 1 / -1; }
.pl-spacer { flex: 1; }

.pl-filters { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1rem; }
.pl-filters .pl-search { min-width: 220px; flex: 1; max-width: 340px; }

/* === Lista de planos === */
.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 1rem; }
.pl-card {
  display: flex; gap: 1rem; padding: 0.9rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-surface); transition: border-color 0.15s;
}
.pl-card:hover { border-color: var(--border-strong, var(--border)); }
.pl-card-cover {
  width: 110px; flex-shrink: 0; border-radius: 10px; background: rgba(255,255,255,0.04) center / cover no-repeat;
  display: grid; place-items: center; color: var(--text-muted); font-size: 1.4rem; min-height: 130px;
}
.pl-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.pl-card-top { display: flex; justify-content: space-between; gap: 0.6rem; align-items: flex-start; }
.pl-card-top h4 { margin: 0; font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }
.pl-card-month { font-size: 0.78rem; color: var(--text-muted); }
.pl-badge {
  display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.7rem; font-weight: 600; white-space: nowrap;
  color: #f59e0b; background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.3);
}
.pl-badge.is-pub { color: #4ade80; background: rgba(34,197,94,0.1); border-color: rgba(34,197,94,0.3); }
.pl-card-stats { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; font-size: 0.78rem; color: var(--text-secondary); }
.pl-card-stats strong { color: var(--text-primary); }
.pl-bar { height: 5px; border-radius: 99px; background: rgba(255,255,255,0.07); overflow: hidden; }
.pl-bar i { display: block; height: 100%; background: #22c55e; border-radius: 99px; }
.pl-card-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-top: auto; }
.pl-confirm { font-size: 0.8rem; color: #f87171; margin-right: 0.3rem; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.76rem; }

@media (max-width: 560px) {
  .pl-grid { grid-template-columns: 1fr; }
  .pl-card { flex-direction: column; }
  .pl-card-cover { width: 100%; min-height: 120px; }
}

/* === Modais === */
.pl-cover-pick { display: flex; align-items: center; gap: 0.8rem; }
.pl-cover-prev {
  width: 120px; height: 84px; border-radius: 10px; border: 1px dashed var(--border-strong, var(--border));
  background: rgba(255,255,255,0.03) center / cover no-repeat; display: grid; place-items: center; color: var(--text-muted);
}
.pl-existing {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; padding: 0.65rem 0.8rem; margin-bottom: 0.9rem;
  border-radius: var(--radius-sm); font-size: 0.8rem; color: #fbbf24; background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.3);
}
.pl-existing label { display: inline-flex; gap: 0.35rem; align-items: center; color: var(--text-primary); cursor: pointer; }
.pl-json { font-family: ui-monospace, Consolas, monospace; font-size: 0.75rem; }
.pl-errbox { margin-top: 0.6rem; padding: 0.6rem 0.8rem; border-radius: var(--radius-sm); font-size: 0.8rem; color: #f87171; background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.3); }
.pl-prev-table { max-height: 230px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.pl-prev-row { display: flex; align-items: baseline; gap: 0.7rem; flex-wrap: wrap; padding: 0.4rem 0.7rem; font-size: 0.78rem; border-bottom: 1px solid var(--border); }
.pl-prev-row:last-child { border-bottom: 0; }
.pl-prev-row.is-bad { background: rgba(239,68,68,0.06); }
.pl-prev-n { color: var(--text-muted); width: 1.4rem; }
.pl-prev-date { font-weight: 700; font-variant-numeric: tabular-nums; }
.pl-prev-fmt { color: var(--accent-text, #7fb0ff); min-width: 4.6rem; }
.pl-prev-head { flex: 1; min-width: 120px; }
.pl-prev-err { flex-basis: 100%; color: #f87171; padding-left: 2.1rem; }
.pl-prev-ok { color: #22c55e; }

/* === Editor === */
.pl-save-state { font-size: 0.75rem; color: var(--text-muted); min-width: 4.5rem; text-align: right; }
.pl-save-state.is-err { color: #f87171; }
.pl-tabs { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.pl-hint { font-size: 0.78rem; color: var(--text-muted); margin: 0.6rem 0 0; }
.pl-posts { display: flex; flex-direction: column; gap: 1.1rem; }

.pl-post { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-surface); padding: 1rem 1.1rem; }
.pl-post-top { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.pl-post-n { font-weight: 700; font-size: 0.9rem; color: var(--text-secondary); min-width: 4rem; }
.pl-date { width: auto; }
.pl-fmt { width: auto; border-color: var(--c); }
.pl-cols { display: grid; grid-template-columns: 1.1fr 1.1fr 0.9fr; gap: 1.1rem; }
.pl-col h5 { margin: 0 0 0.55rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; color: var(--accent-text, #7fb0ff); }
.pl-tela { padding: 0.6rem; margin-bottom: 0.6rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: rgba(255,255,255,0.02); }
.pl-tela-head { display: flex; justify-content: space-between; align-items: center; font-size: 0.68rem; font-weight: 700; color: var(--text-muted); margin-bottom: 0.35rem; }
.pl-lbl { display: block; font-size: 0.64rem; font-weight: 700; letter-spacing: 0.06em; color: var(--accent-text, #7fb0ff); margin: 0.3rem 0 0.2rem; }
.pl-lbl-gray { color: var(--text-muted); }
.pl-caption { min-height: 260px; }

.pl-art {
  aspect-ratio: 4 / 5; border: 2px dashed var(--border-strong, var(--border)); border-radius: var(--radius-sm);
  display: grid; place-items: center; overflow: hidden; color: var(--text-muted); font-size: 0.82rem; background: rgba(255,255,255,0.02);
}
.pl-art.has-art { border-style: solid; }
.pl-art img, .pl-art video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.pl-art-actions { display: flex; gap: 0.4rem; margin-top: 0.5rem; flex-wrap: wrap; }
.pl-ctrl { border: 1px solid var(--border); border-radius: var(--radius-sm); }
.pl-ctrl > div { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--border); font-size: 0.8rem; }
.pl-ctrl > div:last-child { border-bottom: 0; }
.pl-ctrl select { width: auto; padding: 0.25rem 0.5rem; font-size: 0.78rem; }

.pl-internal { margin-top: 1rem; padding-top: 0.8rem; border-top: 1px dashed var(--border); }
.pl-internal-tag { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.5rem; }
.pl-sure { color: #f87171 !important; width: auto !important; padding: 0 0.6rem !important; font-size: 0.75rem; }

@media (max-width: 1100px) { .pl-cols { grid-template-columns: 1fr 1fr; } .pl-col:last-child { grid-column: 1 / -1; } }
@media (max-width: 700px) { .pl-cols { grid-template-columns: 1fr; } }

/* === Carrossel: várias artes no editor === */
.pl-art-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.5rem; }
.pl-art-grid .pl-art { grid-column: 1 / -1; }
.pl-art-item { position: relative; aspect-ratio: 4 / 5; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); background: #000; }
.pl-art-item img, .pl-art-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pl-art-num { position: absolute; top: 6px; left: 6px; min-width: 22px; height: 22px; display: grid; place-items: center; border-radius: 999px; font-size: 0.72rem; font-weight: 700; color: #fff; background: var(--accent, #4f7dff); }
.pl-art-item-actions { position: absolute; inset: auto 0 0; display: flex; justify-content: center; gap: 0.15rem; padding: 0.3rem; background: linear-gradient(transparent, rgba(0,0,0,0.75)); opacity: 0; transition: opacity 0.15s; }
.pl-art-item:hover .pl-art-item-actions { opacity: 1; }
.pl-art { max-height: 62vh; }

/* === Monitor grande: editor maior e mais legível === */
@media (min-width: 1500px) {
  /* Monitor grande: 2 posts lado a lado, cada um com texto e legenda à esquerda e a arte à direita */
  .pl-posts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; align-items: start; }
  .pl-posts > .pl-empty { grid-column: 1 / -1; }
  .pl-cols { grid-template-columns: 1.25fr 0.75fr; grid-template-areas: "t a" "l a"; }
  .pl-cols > .pl-col:nth-child(1) { grid-area: t; }
  .pl-cols > .pl-col:nth-child(2) { grid-area: l; }
  .pl-cols > .pl-col:nth-child(3) { grid-area: a; grid-column: auto; }
  .pl-caption { min-height: 200px; }
  .pl-art { max-height: 50vh; }
  .pl-grid { grid-template-columns: repeat(auto-fill, minmax(560px, 1fr)); }
  .pl-card-cover { width: 150px; }
}
@media (min-width: 2300px) { .pl-grid { grid-template-columns: repeat(auto-fill, minmax(680px, 1fr)); } }

/* === Artes sem corte (stories cabem inteiros) + zoom === */
.pl-art-item img, .pl-art-item video { object-fit: contain; background: #000; }
.pl-art img[data-zoom], .pl-art-item img[data-zoom] { cursor: zoom-in; }
.pl-art.has-art img { object-fit: contain; }

.plz { position: fixed; inset: 0; z-index: 10000; background: rgba(3, 3, 7, 0.94); display: flex; flex-direction: column; }
.plz.hidden { display: none; }
.plz-stage { flex: 1; overflow: auto; display: flex; padding: 3.5rem 1rem 2rem; cursor: zoom-out; }
.plz-stage img { margin: auto; max-width: 96vw; max-height: calc(100vh - 6rem); width: auto; height: auto; object-fit: contain; cursor: zoom-in; border-radius: 8px; }
.plz.zoomed .plz-stage img { max-width: none; max-height: none; width: min(220vw, 2600px); cursor: zoom-out; }
.plz-btn { position: absolute; z-index: 2; width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.18); background: rgba(20,24,40,0.85); color: #fff; cursor: pointer; display: grid; place-items: center; }
.plz-btn:hover { background: var(--accent, #4f7dff); }
.plz-close { top: 14px; right: 14px; }
.plz-prev, .plz-next { top: 50%; transform: translateY(-50%); }
.plz-prev { left: 14px; } .plz-next { right: 14px; }
.plz.single .plz-prev, .plz.single .plz-next { display: none; }
.plz-count { position: absolute; top: 22px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 0.8rem; font-weight: 600; }

/* === Link do layout (público) e link da arte (privado) === */
.pl-note { font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text-muted); }
.pl-lbl-priv { margin-top: 0.9rem; color: #f59e0b; }
.pl-lbl-priv .pl-note { color: #f59e0b; }
.pl-link-row { display: flex; gap: 0.4rem; align-items: center; }
.pl-link-row .form-input { flex: 1; min-width: 0; }
.pl-art-grid { margin-top: 0.6rem; }
.pl-art-open { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 999px; background: rgba(0,0,0,0.65); color: #fff; font-size: 0.65rem; opacity: 0; transition: opacity 0.15s; }
.pl-art-item:hover .pl-art-open { opacity: 1; }
.pl-art-broken { display: none; position: absolute; inset: 0; padding: 0.5rem; align-items: center; justify-content: center; text-align: center; font-size: 0.66rem; line-height: 1.35; color: var(--text-muted); background: var(--bg-surface, #0a0b12); }
.pl-art-item.is-broken .pl-art-broken { display: flex; }
.pl-art-item.is-broken img { display: none; }
.pl-cover-up { display: inline-block; margin-top: 0.4rem; font-size: 0.74rem; color: var(--text-muted); cursor: pointer; text-decoration: underline; }
