/**
 * Push Notifications — estilos do painel.
 */

.push-page {
  display: grid;
  gap: 16px;
}

.push-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.push-toolbar h2 {
  margin: 0 0 4px;
}

.push-toolbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.push-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.push-stat {
  padding: 14px 16px;
}

.push-stat b {
  display: block;
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.push-stat span,
.push-fcm-status {
  color: var(--muted);
  font-size: 0.9rem;
}

.push-pill {
  display: inline-flex;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.push-pill.ok {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
}

.push-pill.warn {
  background: rgba(250, 204, 21, 0.12);
  color: #fde68a;
}

.push-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.9fr);
  gap: 14px;
  align-items: start;
}

.push-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.push-section-head h3 {
  margin: 0;
}

.push-list-toolbar {
  margin-top: 18px;
  margin-bottom: 10px;
}

.push-list-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.push-list {
  display: grid;
  gap: 10px;
}

.push-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.08));
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}

.push-item-title-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.push-item-body {
  margin: 6px 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.push-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 12px;
  color: var(--muted);
}

.push-item-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.push-status {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(124, 92, 255, 0.18);
  color: #d8ccff;
}

.push-status.status-sent { background: rgba(34, 197, 94, 0.16); color: #86efac; }
.push-status.status-scheduled { background: rgba(56, 189, 248, 0.16); color: #7dd3fc; }
.push-status.status-sending { background: rgba(251, 191, 36, 0.16); color: #fde68a; }
.push-status.status-failed { background: rgba(239, 68, 68, 0.16); color: #fca5a5; }

.push-automations {
  display: grid;
  gap: 10px;
}

.push-auto-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.push-auto-row small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.push-side-note {
  margin-top: 12px;
  font-size: 12px;
}

.push-empty {
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.push-composer-host,
.push-progress-host {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 16px;
}

.push-composer-host[hidden],
.push-progress-host[hidden] {
  display: none !important;
}

.push-composer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 4, 12, 0.72);
}

.push-composer,
.push-progress {
  position: relative;
  width: min(640px, 100%);
  max-height: min(90vh, 900px);
  overflow: auto;
  padding: 16px;
}

.push-composer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.push-form {
  display: grid;
  gap: 12px;
}

.push-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.push-form input,
.push-form textarea,
.push-form select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  padding: 10px 12px;
}

.push-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.push-schedule {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
}

.push-radio {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.push-composer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.push-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin: 12px 0;
}

.push-progress-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #7c5cff, #b026ff);
}

.btn.small,
.push-page .btn-sm {
  padding: 6px 10px;
  font-size: 12px;
}

.push-toolbar-actions .btn-primary,
.push-composer-actions .btn-primary {
  color: #fff;
}

.push-toolbar-actions .btn-secondary,
.push-item-actions .btn-secondary,
.push-composer-actions .btn-secondary {
  color: #e8ecf8;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.btn.danger,
.push-page .btn-danger {
  background: linear-gradient(135deg, #ef4444, #e0455c);
  color: #fff;
}

.push-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
}

.push-tab {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
}

.push-tab.active {
  background: rgba(124, 92, 255, 0.22);
  border-color: rgba(124, 92, 255, 0.55);
}

.push-layout-single {
  grid-template-columns: 1fr;
}

.push-template-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.push-chip {
  border: 1px solid color-mix(in srgb, var(--chip, #7c5cff) 45%, transparent);
  background: color-mix(in srgb, var(--chip, #7c5cff) 14%, transparent);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 13px;
}

.push-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.push-template-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid var(--accent, #7c5cff);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.push-template-card header {
  display: flex;
  gap: 10px;
  align-items: center;
}

.push-template-icon {
  font-size: 1.4rem;
}

.push-template-card small,
.push-template-body {
  color: var(--muted);
  font-size: 0.9rem;
}

.push-template-title {
  margin: 0;
  font-weight: 700;
}

.push-auto-intro {
  margin-bottom: 12px;
}

.push-auto-list {
  display: grid;
  gap: 12px;
}

.push-auto-card {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) minmax(260px, 1.2fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.push-auto-toggle {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.push-auto-state {
  font-size: 12px;
  color: var(--muted);
}

.push-auto-main small {
  color: var(--muted);
}

.push-auto-fields {
  display: grid;
  gap: 8px;
}

.push-history-table-wrap {
  overflow: auto;
}

.push-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.push-history-table th,
.push-history-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}

.push-history-table th {
  color: var(--muted);
  font-weight: 600;
}

.push-model-picker-card {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.push-model-picker-label {
  flex: 1;
  min-width: 220px;
}

.push-model-field select,
.push-model-picker-label select,
.push-filters select,
.push-filters input {
  width: 100%;
}

.push-model-preview {
  margin: 8px 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(124, 92, 255, 0.12);
  border: 1px solid rgba(124, 92, 255, 0.25);
  font-size: 0.92rem;
}

.push-auto-audience,
.push-auto-audience-wrap .push-auto-audience {
  margin: 10px 0 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.28);
  color: var(--text, #e8e8ef);
  font-size: 0.92rem;
  line-height: 1.45;
}

.push-auto-audience strong {
  display: block;
  margin-bottom: 4px;
}

.push-auto-audience p,
.push-auto-audience[data-target-hint] {
  margin: 0;
  color: var(--muted, #a8a8b8);
}

.push-field-hint {
  display: block;
  margin-top: 4px;
  opacity: 0.7;
  font-size: 0.82rem;
}

.req {
  color: #f87171;
}

.push-filters {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(140px, 0.7fr) minmax(120px, 0.5fr);
  gap: 10px;
}

.push-composer-wide {
  max-width: 720px;
  width: min(720px, 96vw);
}

.push-form-grid {
  display: grid;
  gap: 12px;
}

.req {
  color: #f87171;
}

.push-template-card.is-inactive {
  opacity: 0.55;
}

.push-template-card header {
  justify-content: space-between;
}

.push-stats-page .push-stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 960px) {
  .push-layout,
  .push-stat-grid,
  .push-form-row,
  .push-item,
  .push-auto-card,
  .push-filters,
  .push-stats-page .push-stat-grid {
    grid-template-columns: 1fr;
  }

  .push-item-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
}
