/* =============================================================
   View Painel — visual Goold
   ============================================================= */

.painel {
  padding: 32px 48px 56px;
  max-width: 1240px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ---------- Cabeçalho da tela ---------- */
.painel__head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
}
.painel__head-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.painel__title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.1;
}
.painel__subtitle {
  font-size: 14px;
  color: var(--text-muted);
}
.painel__head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---------- Card "Próxima ação" ---------- */
.next-action {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 32px;
  box-shadow: var(--shadow-card);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
  transition: transform var(--dur-apple) var(--ease-apple),
              box-shadow var(--dur-apple) var(--ease-apple);
}
.next-action:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-card-hover);
}
.next-action__body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.next-action__pills { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.next-action__canal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}
.next-action__canal-ico {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.next-action__canal-ico svg { width: 22px; height: 22px; display: block; }
.next-action__canal-ico--lucide {
  border-radius: 6px;
  color: #fff;
}
.next-action__canal-ico--usa { background: var(--c-usa); }
.next-action__canal-ico--europa { background: var(--c-europa); }
.next-action__canal-ico--box { background: var(--c-box); }
.next-action__canal-ico--feriado { background: var(--c-feriado); }
.next-action__canal-ico--evento { background: var(--c-evento); }
.next-action__canal-ico--lucide .icon { width: 13px; height: 13px; }

.next-action__when {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
}
.next-action__combo {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
  margin-top: 4px;
}
.next-action__price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 8px;
}
.next-action__price .from {
  font-size: 14px;
  color: var(--text-dim);
  text-decoration: line-through;
}
.next-action__price .to {
  font-size: 22px;
  color: var(--brand);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.next-action__info {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 14px;
}
.next-action__info li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.next-action__info .icon { width: 14px; height: 14px; }

.next-action__cta { align-self: center; }
.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 22px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--dur-apple) var(--ease-apple),
              transform var(--dur-press) ease;
}
.btn-pill:hover { background: var(--brand-strong); }
.btn-pill:active { transform: scale(0.985); }
.btn-pill .icon { width: 14px; height: 14px; }

/* ---------- Stat cards ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.stat {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform var(--dur-apple) var(--ease-apple),
              box-shadow var(--dur-apple) var(--ease-apple);
}
.stat:hover { transform: translateY(-1px); box-shadow: var(--shadow-card-hover); }
.stat__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}
.stat__value {
  font-size: 38px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat__bar { height: 3px; background: var(--bg-3); border-radius: 2px; overflow: hidden; margin-top: 4px; }
.stat__bar > i { display: block; height: 100%; background: var(--text-muted); transition: width 360ms var(--ease-apple); }
.stat--executadas .stat__bar > i { background: var(--positive); }
.stat--aguardando .stat__bar > i { background: var(--warning); }

/* ---------- Progresso do mês (barra segmentada) ---------- */
.painel-progress {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.seg-bar {
  display: flex;
  align-items: stretch;
  height: 8px;
  background: var(--bg-3);
  border-radius: 4px;
  overflow: hidden;
}
.seg { display: block; height: 100%; transition: width 360ms var(--ease-apple); }
.seg--ex { background: var(--positive); }
.seg--ag { background: var(--warning); }
.seg-bar__legend {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.seg-bar__legend strong { color: var(--text); font-weight: 600; }
.seg-bar__pill { color: var(--text); }
.seg-bar__pill--ex::before, .seg-bar__pill--ag::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: 1px;
}
.seg-bar__pill--ex::before { background: var(--positive); }
.seg-bar__pill--ag::before { background: var(--warning); }

/* ---------- Seções ---------- */
.painel-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}
.painel-section__head {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--bg-0);
  padding: 8px 0;
  margin: 0 -2px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  transition: box-shadow var(--dur-apple) var(--ease-apple);
}
.painel-section__head.is-stuck {
  box-shadow: 0 4px 8px -6px rgba(0,0,0,0.10);
}
.painel-section__title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.015em;
}
.canal-count-chip {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-2);
  padding: 4px 10px;
  border-radius: 999px;
}

/* ---------- Lista iOS-Settings ---------- */
.list-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  padding: 4px 20px;
  display: flex;
  flex-direction: column;
}
.list-card--scroll {
  max-height: 520px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #CBD5E1 transparent;
}
.list-card--scroll::-webkit-scrollbar { width: 6px; }
.list-card--scroll::-webkit-scrollbar-track { background: transparent; }
.list-card--scroll::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 3px; }
.list-card--scroll::-webkit-scrollbar-thumb:hover { background: #94A3B8; }
.rel-tag {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.rel-tag::after { content: '·'; margin: 0 4px; color: var(--text-dim); }
.list-card__more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 14px 0;
  background: transparent;
  border: none;
  border-top: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--brand);
  cursor: pointer;
  transition: background var(--dur-apple) var(--ease-apple);
}
.list-card__more:hover { background: var(--bg-2); }
.list-card__more .icon { width: 14px; height: 14px; }

.list-row {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto 16px;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  cursor: pointer;
  background: transparent;
  border: none;
  text-align: left;
  width: 100%;
  transition: background var(--dur-apple) var(--ease-apple),
              transform var(--dur-press) ease;
}
.list-row:hover { background: var(--bg-2); }
.list-row:active { transform: scale(0.99); }
.list-row + .list-row::before {
  content: '';
  position: absolute;
  top: 0;
  left: 44px;
  right: 0;
  height: 1px;
  background: var(--hairline);
}
.list-row__icons { display: inline-flex; align-items: center; gap: 6px; }
.list-row__done {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--positive);
}
.list-row__done .icon { width: 18px; height: 18px; }
.list-row--done {
  opacity: 0.55;
  color: var(--text-muted);
}
.list-row--done .list-row__date,
.list-row--done .list-row__combo,
.list-row--done .list-row__value {
  text-decoration: line-through;
  color: var(--text-muted);
}
.list-row--done:hover { opacity: 0.85; }

.list-row__icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--text-muted);
  color: #fff;
}
.list-row__icon .icon { width: 14px; height: 14px; }
.list-row__icon--usa     { background: var(--c-usa); }
.list-row__icon--europa  { background: var(--c-europa); }
.list-row__icon--box     { background: var(--c-box); }
.list-row__icon--feriado { background: var(--c-feriado); }
.list-row__icon--evento  { background: var(--c-evento); }
.list-row__icon--instagram, .list-row__icon--grupos { background: transparent; }
.list-row__icon--instagram svg, .list-row__icon--grupos svg { width: 28px; height: 28px; display: block; border-radius: 7px; }

.list-row__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.list-row__date {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.list-row__combo {
  font-size: 13px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-row__value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.list-row__chevron { display: flex; align-items: center; color: var(--text-dim); }
.list-row__chevron .icon { width: 16px; height: 16px; }

.list-pill {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}
.list-pill--usa { background: #DBEAFE; color: #1D4ED8; }
.list-pill--europa { background: #EDE9FE; color: #6D28D9; }

/* ---------- Box do mês ---------- */
.box-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.box-grid--n1 { grid-template-columns: 1fr; max-width: 480px; }
.box-grid--n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.box-monthly {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  transition: transform var(--dur-apple) var(--ease-apple),
              box-shadow var(--dur-apple) var(--ease-apple);
}
.box-monthly:hover { transform: translateY(-1px); box-shadow: var(--shadow-card-hover); }
.box-monthly__name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.box-monthly__meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.box-monthly__products {
  list-style: none;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.box-monthly__products li {
  font-size: 14px;
  color: var(--text);
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.box-monthly__products li::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
}

/* Estado vazio */
.painel-empty {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 24px;
  text-align: center;
  color: var(--text-muted);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.painel-empty .icon { color: var(--text-dim); width: 28px; height: 28px; }
.painel-empty p { font-size: 14px; margin: 0; }

/* ---------- Placeholders ---------- */
.placeholder-page {
  padding: 32px 48px 56px;
  max-width: 1240px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.placeholder-head { display: flex; flex-direction: column; gap: 4px; }
.placeholder-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.1;
}
.placeholder-subtitle {
  font-size: 14px;
  color: var(--text-muted);
}
.placeholder-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 56px 24px;
  text-align: center;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.placeholder-icon { width: 48px; height: 48px; color: var(--text-dim); }
.placeholder-card__title { font-size: 22px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.placeholder-card__desc { font-size: 14px; color: var(--text-muted); max-width: 480px; }

/* Usuários table */
.users-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.users-count { font-size: 13px; color: var(--text-muted); }
.users-table {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.users-row {
  display: grid;
  grid-template-columns: 1.5fr 2fr 0.8fr 1fr;
  gap: 16px;
  padding: 14px 20px;
  align-items: center;
  font-size: 14px;
  color: var(--text);
}
.users-row + .users-row { border-top: 1px solid var(--hairline); }
.users-row--head {
  background: var(--bg-2);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  padding: 12px 20px;
}
.users-row__name { display: inline-flex; align-items: center; gap: 12px; font-weight: 500; }
.users-row__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.users-row__email { color: var(--text-muted); font-size: 13px; }
.users-row__role {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 999px;
}
.users-row__role--master { background: var(--brand-soft); color: var(--brand); }
.users-row__role--padrao { background: var(--bg-3); color: var(--text-muted); }
.users-row__access { color: var(--text-muted); font-size: 13px; }
.users-row__access-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.users-row__trash {
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-dim);
  cursor: pointer;
  transition: background var(--dur-apple) var(--ease-apple), color var(--dur-apple) var(--ease-apple), border-color var(--dur-apple) var(--ease-apple);
}
.users-row__trash:hover:not(:disabled) {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: var(--brand-edge);
}
.users-row__trash:disabled { opacity: 0.35; cursor: not-allowed; }
.users-row__trash .icon { width: 16px; height: 16px; }

.users-row--confirm {
  background: var(--brand-soft);
}
.users-row__confirm-text {
  font-size: 13px;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- Modal genérico (add usuário) ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms var(--ease-apple);
  z-index: 300;
}
.modal-backdrop.is-open { opacity: 1; pointer-events: auto; }
.modal {
  position: fixed;
  top: 14vh;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  width: min(440px, calc(100vw - 32px));
  z-index: 310;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms var(--ease-apple), transform 200ms var(--ease-apple);
}
.modal.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.modal-card {
  background: var(--bg-1);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.04);
  overflow: hidden;
}
.modal-card__head {
  padding: 18px 22px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--hairline);
}
.modal-card__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.modal-card__form {
  padding: 18px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field__label { font-size: 12px; color: var(--text-muted); }
.form-field input,
.form-field select {
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-1);
  transition: border-color 160ms var(--ease-apple), box-shadow 160ms var(--ease-apple);
}
.form-field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%236B7280' stroke-width='1.5'><polyline points='4 6 8 10 12 6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
}
.form-field input:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.10);
}
.form-error {
  font-size: 13px;
  color: var(--brand);
  margin-top: -4px;
}
.modal-card__footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

@media (max-width: 1100px) {
  .painel { padding: 28px 32px; }
  .placeholder-page { padding: 28px 32px; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .box-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .painel { padding: 24px 16px; }
  .next-action { grid-template-columns: 1fr; }
  .next-action__info { flex-direction: column; gap: 8px; }
  .stat-grid { grid-template-columns: 1fr; }
  .box-grid { grid-template-columns: 1fr; }
}
