/* Placement.css — kartu "Denah Penempatan" & lembar Formasi (Entity Editor).
 * Token tema saja. Sel persegi lewat aspect-ratio per sel (bukan wadah —
 * wadah beraspect-ratio bisa ditarik tinggi oleh isinya). Denah > 12 sel
 * digulir menyamping dengan sel minimum 30px supaya tetap bisa disentuh. */

.ee-place .ee-place-compass {
  margin: 4px 0;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.ee-place-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding-bottom: 2px;
}

.ee-place-grid {
  display: grid;
  grid-template-columns: repeat(var(--ee-place-size, 8), minmax(30px, 1fr));
  grid-auto-rows: auto;
  gap: 2px;
  width: 100%;
  max-width: 420px;
  min-width: min-content;
  margin: 0 auto;
  padding: 4px;
  box-sizing: border-box;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface-2);
  outline: none;
}

.ee-place .ee-place-grid:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent-teal); }

.ee-place-cell {
  aspect-ratio: 1 / 1;
  min-width: 0;
  border-radius: 3px;
  background: var(--bg-surface);
  cursor: pointer;
}

.ee-place-cell:hover { box-shadow: inset 0 0 0 1px var(--accent-teal); }
.ee-place-cell.is-target { box-shadow: inset 0 0 0 2px var(--accent-teal-bright); }

.ee-place-tile {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  background: var(--bg-surface-2);
  cursor: grab;
  /* Seret ubin tidak boleh menggulir halaman di layar sentuh. */
  touch-action: none;
}

.ee-place-tile.is-active { box-shadow: 0 0 0 2px var(--accent-teal-bright); }
.ee-place-grid.is-dragging .ee-place-tile { cursor: grabbing; }

.ee-place-tile__arrow {
  position: absolute;
  right: 1px;
  bottom: 1px;
  color: var(--accent-teal-bright);
}

.ee-place-tile__count {
  position: absolute;
  top: 0;
  left: 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.2;
  color: var(--text-primary);
}

/* ── Kontrol ─────────────────────────────────────────────────────────── */
.ee-place .ee-place-who {
  margin: 12px 0 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.ee-place-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.ee-place-group,
.ee-place-fill {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ee-place-group__label {
  font-size: 12px;
  color: var(--text-muted);
  margin-right: 2px;
}

.ee-place .ee-place-group .ee-chip {
  min-width: 36px;
  min-height: 36px;
  font-size: 15px;
}

.ee-place-value {
  min-width: 34px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: center;
  color: var(--text-primary);
}

.ee-place-snap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}

.ee-place .ee-place-fill {
  margin-top: 14px;
  flex-wrap: wrap;
}

.ee-place .ee-place-fill .select-input { flex: 1 1 220px; min-height: 40px; }
.ee-place .ee-place-area { margin: 6px 0 0; }

/* ── Lembar Formasi ──────────────────────────────────────────────────── */
.ee-form-sheet .bottom-sheet__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 16px 20px;
  overflow-y: auto;
}

.ee-form-sheet .bottom-sheet__body > * { flex-shrink: 0; }

.ee-form-sheet .ee-form-label {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.ee-form-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 150px;
  overflow-y: auto;
  padding: 4px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.ee-form-list__pick {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  font-size: 13px;
  cursor: pointer;
}

.ee-form-sheet .ee-chip { align-self: flex-start; min-height: 34px; }

.ee-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ee-seg .ee-seg__btn {
  flex: 1 1 auto;
  min-height: 38px;
  padding: 6px 12px;
  font-size: 13px;
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.ee-seg .ee-seg__btn.is-active {
  border-color: var(--accent-teal);
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px var(--accent-teal);
}

.ee-form-step {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ee-form-step .ee-form-label { min-width: 52px; margin: 0; }
.ee-form-sheet .ee-form-step .ee-chip { min-width: 38px; font-size: 15px; align-self: center; }

.ee-form-prev {
  display: grid;
  grid-template-columns: repeat(var(--ee-prev-size, 4), 1fr);
  gap: 1px;
  width: min(100%, 240px);
  margin: 4px auto 0;
  padding: 3px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-surface-2);
}

.ee-form-prev__cell {
  aspect-ratio: 1 / 1;
  background: var(--bg-surface);
  border-radius: 1px;
}

.ee-form-prev__dot {
  position: relative;
  z-index: 1;
  margin: 18%;
  border-radius: 50%;
  background: var(--accent-teal);
}

.ee-form-prev__dot::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 90%;
  height: 2px;
  transform-origin: 0 50%;
  transform: rotate(var(--ee-prev-angle, 0deg));
  background: var(--text-primary);
}

.ee-form-prev__dot.is-lead { background: var(--accent-teal-bright); }

.ee-form-sheet .ee-form-error { margin: 0; font-size: 13px; color: var(--accent-danger); }
.ee-form-sheet .ee-hint { margin: 0; }
.ee-form-sheet .ee-form-apply { min-height: 44px; }

/* ── Sel kosong terpilih + bilah aksi (cellActions.js) ──────────────── */
.ee-place-cell.is-pending {
  position: relative;
  box-shadow: inset 0 0 0 2px var(--accent-teal-bright);
  background: var(--bg-hover);
}
.ee-place-cell.is-pending::after {
  content: "+";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--accent-teal-bright);
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
}

.ee-cell-actions {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-hover);
}
.ee-cell-actions[hidden] { display: none; }
.ee-cell-actions__title {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.ee-cell-actions__row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ee-place .ee-cell-actions__btn {
  flex: 1 1 auto;
  flex-shrink: 0;
  min-height: 36px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ee-place .ee-cell-actions__btn--add {
  flex-basis: 100%;
  border-color: var(--accent-teal);
  color: var(--accent-teal-bright);
  font-weight: 600;
}
.ee-place .ee-cell-actions__btn--cancel { flex: 0 0 auto; }

.ee-place-who-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin: 12px 0 8px;
}
.ee-place .ee-place-who-row .ee-place-who { margin: 0; flex: 1 1 180px; }
