/* ─── WRAPPER ────────────────────────────────────────────── */
.action-plan-resolve {
  width: 100%;
  padding: 20px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* ─── HEADER ─────────────────────────────────────────────── */
.action-plan-resolve .page-header {
  border: 1px solid var(--border-light-mode);
  margin: -20px -20px 0.5rem -20px;
  background-color: var(--card-light-header);
  padding: 40px 20px;
  text-align: center;
  border-top-left-radius: 15px;
  border-top-right-radius: 15px;
  position: relative;
}

html.dark-theme .action-plan-resolve .page-header {
  background-color: var(--background-dark-mode-menu-lateral);
  border-color: var(--border-dark-mode);
}

.action-plan-resolve .header-content {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.action-plan-resolve .header-left {
  display: flex;
  align-items: center;
  position: absolute;
  left: 0;
}

.action-plan-resolve .btn-voltar {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0;
}

.action-plan-resolve .btn-voltar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  font-size: 0.85rem;
  transition:
    background-color 0.2s,
    color 0.2s;
  flex-shrink: 0;
}

.action-plan-resolve .btn-voltar:hover .btn-voltar-circle {
  background-color: var(--primary-color);
  color: var(--text-thowine-light);
}

.action-plan-resolve .btn-voltar-label {
  color: var(--primary-color);
  font-size: 1rem;
  font-weight: 500;
}

.action-plan-resolve .page-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

html.dark-theme .action-plan-resolve .page-title {
  color: var(--text-thowine-dark);
}

/* ─── CONTAINER PRINCIPAL ────────────────────────────────── */
.action-plan-resolve .resolve-main-container {
  background-color: var(--backgroud-container-child);
  border: 1px solid var(--border-light-mode);
  border-radius: 0 0 12px 12px;
  margin: 0 -20px;
  padding: 25px;
}

html.dark-theme .action-plan-resolve .resolve-main-container {
  background-color: var(--background-dark-mode-menu-lateral);
  border-color: var(--border-dark-mode);
}

/* ─── FOOTER DE AÇÕES ────────────────────────────────────── */
.action-plan-resolve .resolve-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light-mode);
  margin-top: 20px;
}

html.dark-theme .action-plan-resolve .resolve-footer {
  border-top-color: var(--border-dark-mode);
}

/* ─── GRID ──────────────────────────────────────────────── */
.action-plan-resolve .ap-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.action-plan-resolve .full-width {
  grid-column: 1 / -1;
}

/* ─── SEÇÕES INTERNAS ────────────────────────────────────── */
.action-plan-resolve .resolve-section {
  background: var(--surface-hover, #f8fafc);
  padding: 20px;
  border-radius: 10px;
  border: 1px solid var(--border, #e2e8f0);
  min-width: 0;
}

html.dark-theme .action-plan-resolve .resolve-section {
  background: var(--background-main-dark-mode);
  border-color: var(--background-main-dark-mode);
}

.action-plan-resolve .resolve-section--history {
  background: var(--background-inputs-light-mode);
}

html.dark-theme .action-plan-resolve .resolve-section--history {
  background: var(--background-main-dark-mode);
  border-color: var(--border-dark-mode);
}

.action-plan-resolve .resolve-comment-card {
  background: var(--card-bg, #ffffff);
  padding: 15px;
  border-radius: 10px;
  border: 1px solid var(--border-light-mode);
  margin-bottom: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

html.dark-theme .action-plan-resolve .resolve-comment-card {
  background: var(--background-dark-mode-menu-lateral);
  border-color: var(--border-dark-mode);
}

.action-plan-resolve .resolve-comment-card__meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
}

html.dark-theme .action-plan-resolve .resolve-comment-card__meta {
  color: var(--text-thowine-dark);
}

.action-plan-resolve .resolve-comment-card__text {
  font-size: 0.95rem;
  color: var(--text-primary, #1e293b);
  white-space: pre-wrap;
  line-height: 1.5;
}

html.dark-theme .action-plan-resolve .resolve-comment-card__text {
  color: var(--text-thowine-dark);
}

.action-plan-resolve .resolve-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary, #1e293b);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 5px;
}

html.dark-theme .action-plan-resolve .resolve-section-title {
  color: var(--text-thowine-dark);
}

/* ─── INPUTS E TEXTAREA ─────────────────────────────────── */
.action-plan-resolve .ap-input {
  width: 100%;
  padding: 12px 15px;
  border-radius: 8px;
  border: 2px solid var(--border-light-mode);
  background: var(--background-color-main-light);
  font-size: 1rem;
  color: var(--text-thowine-black-light);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  box-sizing: border-box;
  margin-top: 5px;
}

.action-plan-resolve .ap-input:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

html.dark-theme .action-plan-resolve .ap-input {
  background: var(--background-main-dark-mode);
  border-color: var(--border-dark-mode);
  color: var(--text-thowine-dark);
}

.action-plan-resolve .ap-input--mb {
  margin-bottom: 15px;
}

.action-plan-resolve #resolve-notes {
  resize: none;
}

.action-plan-resolve .ap-input:disabled {
  background: #ffffff;
  color: var(--text-thowine-light);
  cursor: not-allowed;
  opacity: 0.8;
}

html.dark-theme .action-plan-resolve .ap-input:disabled {
  background: #2a2a2a;
  color: var(--text-thowine-dark);
  border-color: var(--border-dark-mode);
}

.action-plan-resolve .char-counter {
  font-size: 11px;
  color: #6b7280;
  display: block;
  margin-top: 5px;
  font-weight: 500;
}

/* ─── TAGS DE STATUS E PRIORIDADE ────────────────────────── */
.action-plan-resolve .ap-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 5px;
  font-size: 0.8rem;
  font-weight: 700;
}

.action-plan-resolve .tag-critical {
  background: #fee2e2;
  color: #dc2626;
}
.action-plan-resolve .tag-high {
  background: #ffedd5;
  color: #ea580c;
}

.action-plan-resolve .tag-normal {
  color: var(--text-thowine-black-light);
}
html.dark-theme .action-plan-resolve .tag-normal {
  color: var(--text-thowine-dark);
}

.action-plan-resolve .tag-low {
  background: #f0fdf4;
  color: #16a34a;
}

.action-plan-resolve .resolve-media-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.action-plan-resolve .resolve-btn-media {
  flex: 1;
  min-width: 100px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #fff;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-size: 0.85rem;
  transition:
    background 0.2s,
    transform 0.2s;
}

html.dark-theme .action-plan-resolve .resolve-btn-media {
  background-color: var(--background-dark-mode-menu-lateral);
  border-color: var(--border-dark-mode);
  color: var(--text-thowine-dark);
}

.action-plan-resolve .resolve-btn-media i {
  font-size: 1.2rem;
}

.action-plan-resolve .resolve-btn-media:hover {
  background: #f1f5f9;
  transform: translateY(-2px);
}

.action-plan-resolve .resolve-btn-media.active-rec {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
  animation: pulseRecording 1.5s infinite;
}

@keyframes pulseRecording {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.action-plan-resolve .resolve-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 15px;
}

.action-plan-resolve .gallery-item {
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  position: relative;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.action-plan-resolve .gallery-item--gps {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.action-plan-resolve .gallery-item-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  padding: 6px 10px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  letter-spacing: 0.5px;
}

.action-plan-resolve .gallery-item--gps .gallery-item-label {
  background: #dbeafe;
  border-color: #bfdbfe;
  color: #1e40af;
}

.action-plan-resolve .gallery-item-body {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px;
  padding: 10px;
  font-size: 2rem;
  color: #94a3b8;
}

.action-plan-resolve .gallery-item--gps .gallery-item-body {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 12px 15px;
  gap: 4px;
  font-size: 1rem;
}

.action-plan-resolve .gallery-item-body p {
  font-size: 0.85rem;
  color: #1e40af;
  margin: 0;
  font-weight: 600;
}

.action-plan-resolve .gallery-item-body--img {
  padding: 0;
  height: 120px;
}

.action-plan-resolve .gallery-item-body--img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.action-plan-resolve .btn-remove-item {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(220, 38, 38, 0.9);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  cursor: pointer;
}

.action-plan-resolve #resolve-comments-feed {
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0;
  text-align: left;
}

.action-plan-resolve .ap-page-footer {
  padding: 20px 25px;
  border: 1px solid var(--border-light-mode);
  border-top: none;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  background-color: var(--background-color-main-light);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

html.dark-theme .action-plan-resolve .ap-page-footer {
  background-color: var(--background-main-dark-mode);
  border-color: var(--border-dark-mode);
}

.action-plan-resolve .ap-btn-cancelar {
  padding: 12px 25px;
  background: var(--background-main);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  color: var(--text-thowine-black-light);
  cursor: pointer;
}

html.dark-theme .action-plan-resolve .ap-btn-cancelar {
  background-color: var(--background-main-dark-mode);
  color: var(--text-thowine-dark);
}

.action-plan-resolve .ap-btn-salvar {
  padding: 12px 30px;
  background: var(--primary-color);
  border: none;
  border-radius: 8px;
  font-weight: 700;
  color: var(--text-thowine-black-light);
  cursor: pointer;
  min-width: 200px;
}

html.dark-theme .action-plan-resolve .ap-btn-salvar {
  color: var(--text-thowine-black-light);
}

@media (max-width: 768px) {
  .action-plan-resolve .ap-modal-grid {
    grid-template-columns: 1fr;
  }
  .action-plan-resolve .resolve-main-container {
    padding: 15px;
  }
  .action-plan-resolve .resolve-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}
