/* ═══════════════════════════════════════════════════════════════════════════
   PLANOS — Plano de Ações, Tarefas e Metas
   Cole no arquivo CSS principal do Terra (ex: terra.css ou main.css)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Layout do board ─────────────────────────────────────────────────────── */
.planos-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0 18px;
}

.planos-board {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 20px;
  min-height: calc(100vh - 220px);
}

/* ── Coluna ──────────────────────────────────────────────────────────────── */
.planos-col {
  flex: 0 0 220px;
  min-width: 200px;
  max-width: 240px;
  background: #f5f0ea;
  border-radius: 10px;
  padding: 10px 8px;
  transition: background 0.18s;
}

.planos-col.drag-over {
  background: #ede3d4;
  outline: 2px dashed #BA7517;
}

.planos-col-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px 10px;
  font-weight: 600;
  font-size: 13px;
  color: #472E16;
}

.planos-col-header.col-achieved {
  color: #7a5a00;
}

.col-icon { font-size: 16px; }

.col-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.col-count {
  background: #c9a96e44;
  color: #6b4a1e;
  font-size: 11px;
  font-weight: 700;
  border-radius: 20px;
  padding: 1px 7px;
  min-width: 22px;
  text-align: center;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.planos-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 60px;
}

.planos-card {
  background: #fff;
  border: 1px solid #e2d5c3;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: grab;
  transition: box-shadow 0.15s, transform 0.12s;
  user-select: none;
}

.planos-card:hover {
  box-shadow: 0 3px 10px #47301620;
  transform: translateY(-1px);
}

.planos-card.dragging {
  opacity: 0.4;
  transform: rotate(2deg);
  cursor: grabbing;
}

.planos-card.card-overdue {
  border-left: 3px solid #C0392B;
}

.card-top {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 5px;
  min-height: 18px;
}

.card-priority { font-size: 10px; }

.card-tag {
  font-size: 10px;
  font-weight: 600;
  border-radius: 20px;
  padding: 1px 7px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: #2d1a0a;
  line-height: 1.35;
  word-break: break-word;
}

.card-desc {
  font-size: 11px;
  color: #7a6248;
  margin-top: 4px;
  line-height: 1.4;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.card-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #BA7517;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-avatar.empty {
  background: #d9cfc4;
  color: #8a7a68;
}

.card-date {
  font-size: 10px;
  color: #9a8070;
}

.card-date.date-late {
  color: #C0392B;
  font-weight: 600;
}

/* ── Dicas de drop ────────────────────────────────────────────────────────── */
.card-drop-hint {
  font-size: 11px;
  color: #c2b09e;
  text-align: center;
  padding: 8px 4px;
  border: 1px dashed #ddd0be;
  border-radius: 6px;
  margin-top: 4px;
}

.achieved-cta {
  font-size: 12px;
  color: #7a5a00;
  text-align: center;
  padding: 8px 4px;
  border: 1px dashed #e0c97e;
  border-radius: 6px;
  margin-top: 4px;
  cursor: pointer;
  background: #fff9ec;
  transition: background 0.15s;
}
.achieved-cta:hover { background: #fff3cc; }

/* ── Botões ───────────────────────────────────────────────────────────────── */
.btn-terra {
  background: #BA7517;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.15s;
}
.btn-terra:hover { background: #9e6012; }

.btn-terra-ghost {
  background: transparent;
  color: #BA7517;
  border: 1.5px solid #BA7517;
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-terra-ghost:hover { background: #BA751710; }

.btn-danger {
  background: #C0392B;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-danger:hover { background: #9b2e22; }

.btn-gold {
  background: linear-gradient(135deg, #f4c542, #e09f10);
  color: #472E16;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-gold:hover { opacity: 0.9; }

/* ── Modais ───────────────────────────────────────────────────────────────── */
.planos-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(30, 15, 5, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}

.planos-modal {
  background: #fff;
  border-radius: 12px;
  width: min(540px, 96vw);
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 40px #47301650;
}

.planos-modal-sm { width: min(420px, 96vw); }
.planos-modal-lg { width: min(680px, 96vw); }

.planos-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid #ecdcca;
  font-weight: 700;
  font-size: 15px;
  color: #472E16;
  flex-shrink: 0;
}

.achieve-header {
  background: linear-gradient(135deg, #fff8e6, #ffefc0);
  color: #6a4200;
  border-radius: 12px 12px 0 0;
}

.modal-close-btn {
  background: none;
  border: none;
  color: #9a8070;
  font-size: 18px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  transition: color 0.15s;
}
.modal-close-btn:hover { color: #472E16; }

.planos-modal-body {
  padding: 18px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.planos-modal-body label {
  font-size: 12px;
  font-weight: 700;
  color: #7a6248;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: -6px;
}

.planos-modal-body input,
.planos-modal-body select,
.planos-modal-body textarea {
  width: 100%;
  border: 1.5px solid #e2d5c3;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  color: #2d1a0a;
  background: #fff;
  box-sizing: border-box;
  transition: border-color 0.15s;
  font-family: inherit;
}

.planos-modal-body input:focus,
.planos-modal-body select:focus,
.planos-modal-body textarea:focus {
  outline: none;
  border-color: #BA7517;
  box-shadow: 0 0 0 3px #BA751718;
}

.planos-modal-body textarea {
  resize: vertical;
  min-height: 68px;
}

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

.req { color: #C0392B; }

.planos-modal-footer {
  padding: 12px 20px 16px;
  border-top: 1px solid #ecdcca;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

/* ── Conquistas ───────────────────────────────────────────────────────────── */
.achieve-intro {
  background: #fff8e6;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  color: #5a3d00;
  line-height: 1.5;
}

.achieve-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f0e6d6;
}
.achieve-item:last-child { border-bottom: none; }

.achieve-trophy {
  font-size: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}

.achieve-plan-title {
  font-weight: 700;
  font-size: 13px;
  color: #472E16;
}

.achieve-gain {
  font-size: 14px;
  color: #2a5e3a;
  margin: 3px 0;
  line-height: 1.4;
}

.achieve-meta {
  font-size: 11px;
  color: #9a8070;
}

.empty-achieve {
  text-align: center;
  color: #b09070;
  font-size: 14px;
  padding: 30px 0;
}

/* ── Checklist — barra de progresso no card ──────────────────────────────── */
.card-checklist-preview {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 2px;
}
.cl-bar-wrap {
  flex: 1;
  height: 4px;
  background: #ede3d4;
  border-radius: 99px;
  overflow: hidden;
}
.cl-bar-fill {
  height: 100%;
  background: #BA7517;
  border-radius: 99px;
  transition: width 0.3s ease;
}
.cl-count {
  font-size: 9px;
  font-weight: 700;
  color: #9a8070;
  white-space: nowrap;
}

/* ── Checklist — seção dentro do modal ───────────────────────────────────── */
.cl-section {
  border-top: 1px solid #ede3d4;
  padding-top: 12px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cl-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cl-section-label {
  font-size: 12px;
  font-weight: 700;
  color: #7a6248;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cl-progress-txt {
  font-size: 11px;
  font-weight: 700;
  color: #BA7517;
  background: #BA751518;
  border-radius: 20px;
  padding: 1px 8px;
}
.cl-empty {
  font-size: 11px;
  color: #b09070;
  font-style: italic;
  padding: 4px 0;
}
.cl-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 2px;
  border-radius: 5px;
  transition: background 0.12s;
}
.cl-item:hover { background: #faf6f0; }
.cl-cb {
  width: 16px;
  height: 16px;
  border: 2px solid #d9cfc4;
  border-radius: 4px;
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  background: #fff;
}
.cl-cb.checked {
  background: #BA7517;
  border-color: #BA7517;
}
.cl-cb.checked::after {
  content: '✓';
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.cl-item-text {
  flex: 1;
  font-size: 12px;
  color: #3d2510;
  line-height: 1.4;
}
.cl-item-text.done {
  text-decoration: line-through;
  color: #b09070;
}
.cl-del-btn {
  background: none;
  border: none;
  color: #c2b09e;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
.cl-item:hover .cl-del-btn { opacity: 1; }
.cl-del-btn:hover { color: #C0392B; }
.cl-add-row {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}
.cl-add-row input {
  flex: 1;
  border: 1.5px solid #e2d5c3;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  color: #2d1a0a;
  background: #fff;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.cl-add-row input:focus {
  outline: none;
  border-color: #BA7517;
  box-shadow: 0 0 0 3px #BA751718;
}
.btn-cl-add {
  background: #BA7517;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
  line-height: 1;
}
.btn-cl-add:hover { background: #9e6012; }
